#include <ShlObj.h>
int write_session()
{char  path[100];
SHGetFolderPath(NULL, 
                CSIDL_PROFILE,
                 NULL,
				 0, 
                 path);
strcat(path,"\\last_data.in");
FILE *fout=fopen(path,"wt");
if (!fout)
    return 0;
for (int i=0;i<12;i++)
	   if (strcmp(mat[i],"")==0) 
		     fprintf(fout,"- ");
	   else fprintf(fout,"%s ",mat[i]);
fclose(fout);
return 1;
}

int read_session()
{char  path[100];
SHGetFolderPath(NULL, 
                CSIDL_PROFILE,
                 NULL,
				 0, 
                 path);
strcat(path,"\\last_data.in");
	int l=0;
	char s[1024],*p;
	FILE *f=fopen(path,"rt");
	if(!f)
		return 0;
	fgets(s,sizeof(s),f);
		p=strtok(s," \n");
	while(p)
	{
		if(strcmp(p,"-")==0)
			strcpy(mat[l],"");
		else
            strcpy(mat[l],p);
		p=strtok(NULL," \n");
		l++;
	}
	fclose(f);
	return 1;
}